﻿using Ledict.ConditionExtract.DAL;
using Ledict.ConditionExtract.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ledict.ConditionExtract.BLL
{
    public class ExtractFeatureBLL
    {
        ExtractFeatureDAL dal = new ExtractFeatureDAL();

        /// <summary>
        /// 获取节点配置信息
        /// </summary>
        /// <param name="nodeName">段落编号或者节点XmlPath</param>
        /// <param name="nodeType">0代表段落1代表要素</param>
        /// <returns>配置信息数据</returns>
        public DataTable GetExtractFeatureData(string nodeName, Int32 nodeType)
        {
            return dal.GetExtractFeatureData(nodeName, nodeType);
        }
        /// <summary>
        /// 获取节点配置信息
        /// </summary>
        /// <param name="nodeName">段落编号或者节点XmlPath</param>
        /// <param name="nodeType">0代表段落1代表要素</param>
        /// <param name="moduleCode">模块名称</param>
        /// <returns>配置信息数据</returns>
        public DataTable GetExtractFeatureData(string nodeName, Int32 nodeType, string moduleCode)
        {
            return dal.GetExtractFeatureData(nodeName, nodeType, moduleCode);
        }

        /// <summary>
        /// 获取节点配置信息
        /// </summary>
        /// <param name="nodeName">段落编号或者节点XmlPath</param>
        /// <param name="nodeType">0代表段落1代表要素</param>
        /// <returns>配置信息数据</returns>
        public DataTable GetExtractFeatureData(string nodeName, Int32 nodeType, Tuple<string, string> tuples)
        {
            return dal.GetExtractFeatureData(nodeName, nodeType, tuples);
        }

        /// <summary>
        /// 增加ExtractFeature表数据
        /// </summary>
        public bool ExtractFeatureAdd(ExtractFeature model)
        {
            return dal.ExtractFeatureAdd(model);
        }

        /// <summary>
        /// 增加ExtractFeature表数据
        /// </summary>
        public bool ExtractInfoAdd(ExtractInfo model)
        {
            return dal.ExtractInfoAdd(model);
        }

        /// <summary>
        ///     取出本次数据总数
        /// </summary>
        /// <param name="headWords"></param>
        /// <returns></returns>
        public int GetIsPublic(ExtractFeature extractFeatureModel)
        {
            return dal.GetIsPublic(extractFeatureModel);
        }

        /// <summary>
        /// 修改ExtractFeature表数据
        /// </summary>
        public bool ExtractFeatureUpdate(ExtractFeature model)
        {
            return dal.ExtractFeatureUpdate(model);
        }

        /// <summary>
        /// 修改ExtractFeature表数据
        /// </summary>
        public bool ExtractFeatureUpdateCMID(ExtractFeature model)
        {
            return dal.ExtractFeatureUpdateCMID(model);
        }

        /// <summary>
        /// 删除ExtractInfo表数据
        /// </summary>
        public bool ExtractInfoDelete(string exiId)
        {
            return dal.ExtractInfoDelete(exiId);
        }

        /// <summary>
        /// 删除ExtractFeature表数据
        /// </summary>
        public bool ExtractFeatureDelete(string efId)
        {
            return dal.ExtractFeatureDelete(efId);
        }

        /// <summary>
        /// 获取节点配置信息
        /// </summary>
        /// <param name="nodeName">段落编号或者节点XmlPath</param>
        /// <param name="nodeType">0代表段落1代表要素</param>
        /// <returns>配置信息数据</returns>
        public string GetExtractInfoData(string nodeName, Int32 nodeType)
        {
            return dal.GetExtractInfoData(nodeName, nodeType);
        }

        /// <summary>
        /// 获取模块配置信息
        /// </summary>
        /// <param name="nodeName">段落编号或者节点XmlPath</param>
        /// <param name="nodeType">0代表段落1代表要素</param>
        /// <returns>配置信息数据</returns>
        public DataTable GetModuleCodeData(string nodeName, Int32 nodeType, string moduleName)
        {
            return dal.GetModuleCodeData(nodeName, nodeType, moduleName);
        }

        /// <summary>
        /// 批量添加前删除表数据
        /// </summary>
        /// <param name="exiID"></param>
        /// <param name="ModuleCode"></param>
        /// <returns></returns>
        public bool DeleteExtractFeature(string exiID, string ModuleCode)
        {
            return dal.DeleteExtractFeature(exiID, ModuleCode);
        }

        /// <summary>
        /// 根据查询条件获取需要查找的节点
        /// </summary>
        /// <param name="type">0代表段落1代表要素</param>
        /// <param name="condition">efid</param>
        /// <returns>根据efid返回节点树上的节点</returns>
        public string GetDataBySearchCondition(int type, string condition)
        {
            return dal.GetDataBySearchCondition(type, condition);
        }
    }
}
